# 导包
import requests
import config


# 创建接口类
class StaffAPI:
    # 添加员工
    def insert_staff(self, insert_data, token):
        return requests.post(url=f"{config.BASE_URL}/api/sys/user", json=insert_data, headers={"Authorization": token})

    # 查询员工
    def select_staff(self,id,token):
        return requests.get(url=f"{config.BASE_URL}/api/sys/user/{id}",headers={"Authorization": token})

    # 修改员工
    def update_staff(self,id,token,update_data):
        return requests.put(url=f"{config.BASE_URL}/api/sys/user/{id}",json=update_data,headers={"Authorization": token})

    # 删除员工
    def delete_staff(self,id,token):
        return requests.delete(url=f"{config.BASE_URL}/api/sys/user/{id}",headers={"Authorization": token})